package com.jimmy.medical.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/** 
 * 规范词
 * 
 * @author jimmy
 * @version $Revision: 19106 $
 * @since 0.1
 */
@Entity
@Table(name = "sys_code")
public class SysCode extends AbstractEntity {
	/**
	 * 代码
	 */
	@Column(name = "node_code", length = 50)
	private String code;
	/**
	 * 上级
	 */
	@ManyToOne
    @JoinColumn(name = "parent_id")
    @NotFound(action = NotFoundAction.IGNORE)
	private SysCode parent;
	/**
	 * 代码类别
	 */
	@Column(name = "code_sort",length = 30)
	private String codeSort;
	/**
	 * 名称
	 */
	@Column(name = "node_name",length = 200)
	private String name;
	/**
	 * 简称
	 */
	@Column(name = "short_name",length = 200)
	private String shortName;
	/**
	 * 是否加载到容器，等于Y则需要加载到容器
	 */
	@Column(name = "load_container",length = 1)
	private String loadContainer;
	/**
	 * 所属系统代码
	 */
	@Column(name = "app_code",length = 30)
	private String appCode;
	/**
	 * 是否可选
	 */
	@Column(name = "is_enable",length = 1)
	private String isEnable;
	/**
	 * 是否显示到app
	 */
	@Column(name = "is_show_app",length = 1)
	private String isShowApp;
	/**
	 * 是否叶子节点
	 */
	@Transient
	private String isLeaf;
	/**
	 * 说明
	 */
	@Column(name = "description",length = 70)
	private String description;
	
	
	/**
	 * 所属城市(逗号分隔，前后无逗号，如果要like查询，自己在前面和后面加上逗号“‘，’||‘”)
	 */
	@Column(name = "city_list", length = 128)
	private String cityList;
	
	
	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public SysCode getParent() {
		return parent;
	}
	public void setParent(SysCode parent) {
		this.parent = parent;
	}
	public String getCodeSort() {
		return codeSort;
	}
	public void setCodeSort(String codeSort) {
		this.codeSort = codeSort;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	public String getLoadContainer() {
		return loadContainer;
	}
	public void setLoadContainer(String loadContainer) {
		this.loadContainer = loadContainer;
	}
	public String getAppCode() {
		return appCode;
	}
	public void setAppCode(String appCode) {
		this.appCode = appCode;
	}
	public String getIsEnable() {
		return isEnable;
	}
	public void setIsEnable(String isEnable) {
		this.isEnable = isEnable;
	}
	public String getIsShowApp() {
		return isShowApp;
	}
	public void setIsShowApp(String isShowApp) {
		this.isShowApp = isShowApp;
	}
	@Transient
	public String getIsLeaf() {
		return isLeaf;
	}
	@Transient
	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	public String getCityList() {
		return cityList;
	}
	public void setCityList(String cityList) {
		this.cityList = cityList;
	}
}